import json
import os.path

import pymysql
from PySide6.QtGui import QKeySequence, QShortcut, QAction
from PySide6.QtWidgets import QMainWindow, QMessageBox, QTreeWidgetItem, QTreeWidget, QMenu, QInputDialog, QLineEdit, \
    QPushButton
from PySide6.QtUiTools import QUiLoader
from PySide6.QtCore import Qt, QPoint

from controllers.fav_connection import FavConnection
from controllers.login.tab_proxy import TabProxy
from controllers.login.tab_standard import TabStandard
from global_variables import GlobalVariables
from mysql.model import Model


class Login(QMainWindow):
    def __init__(self, app):
        super().__init__()
        self.app = app

        self.ui = QUiLoader().load(GlobalVariables.PROJECT_BASE_PATH + 'resource/ui/login.ui')
        self.app.ui = self.ui

        # 两个标签未开发，禁用掉
        self.ui.tab_SSH.setEnabled(False)
        self.ui.tab_socket.setEnabled(False)

        self.app.ui = self.ui
        self.app.fav = FavConnection(self.app)
        self.app.login_tab_standard = TabStandard(self.app)
        self.app.login_tab_proxy = TabProxy(self.app)



if __name__ == '__main__':
    pass
